package service.reader.impl;

import dao.reader.Borrow_booksDao;
import dao.reader.impl.Borrow_booksDaoImpl;
import entity.Borrow_books;
import entity.Pages;
import service.reader.Borrow_booksService;

import java.util.List;

/**
 * Borrow_booksServiceImpl
 *
 * @author lenovo
 * @since 2023/9/4
 */
public class Borrow_booksServiceImpl implements Borrow_booksService {

    //引入数据访问层
    Borrow_booksDao dao = new Borrow_booksDaoImpl();

    @Override
    public List<Borrow_books> getList(String condition, String conditionValue, Object card_id, Pages<Borrow_books> pages) {
        int pageSize = pages.getPageSize();
        int pageIndex = (pages.getPageCountNo() - 1) * pageSize;
        return dao.getList(condition,conditionValue,card_id,pageIndex,pageSize);
    }

    @Override
    public int total(String condition, String conditionValue, Object  card_id) {
        return dao.total(condition,conditionValue,card_id);
    }
}
